package com.ruoyi.subject.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.screeningDate.domain.Dcdate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.subject.mapper.FirefighterSubjectMapper;
import com.ruoyi.subject.domain.FirefighterSubject;
import com.ruoyi.subject.service.IFirefighterSubjectService;

/**
 * 体能科目项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class FirefighterSubjectServiceImpl implements IFirefighterSubjectService 
{
    @Autowired
    private FirefighterSubjectMapper firefighterSubjectMapper;

    /**
     * 查询体能科目项目
     * 
     * @param id 体能科目项目主键
     * @return 体能科目项目
     */
    @Override
    public FirefighterSubject selectFirefighterSubjectById(Long id)
    {
        return firefighterSubjectMapper.selectFirefighterSubjectById(id);
    }

    /**
     * 查询体能科目项目列表
     * 
     * @param firefighterSubject 体能科目项目
     * @return 体能科目项目
     */
    @Override
    public List<FirefighterSubject> selectFirefighterSubjectList(FirefighterSubject firefighterSubject)
    {
        return firefighterSubjectMapper.selectFirefighterSubjectList(firefighterSubject);
    }

    /**
     * 新增体能科目项目
     * 
     * @param firefighterSubject 体能科目项目
     * @return 结果
     */
    @Override
    public int insertFirefighterSubject(FirefighterSubject firefighterSubject)
    {
        firefighterSubject.setCreateTime(DateUtils.getNowDate());
        return firefighterSubjectMapper.insertFirefighterSubject(firefighterSubject);
    }

    /**
     * 修改体能科目项目
     * 
     * @param firefighterSubject 体能科目项目
     * @return 结果
     */
    @Override
    public int updateFirefighterSubject(FirefighterSubject firefighterSubject)
    {
        firefighterSubject.setUpdateTime(DateUtils.getNowDate());
        return firefighterSubjectMapper.updateFirefighterSubject(firefighterSubject);
    }

    /**
     * 批量删除体能科目项目
     * 
     * @param ids 需要删除的体能科目项目主键
     * @return 结果
     */
    @Override
    public int deleteFirefighterSubjectByIds(Long[] ids)
    {
        return firefighterSubjectMapper.deleteFirefighterSubjectByIds(ids);
    }

    /**
     * 删除体能科目项目信息
     * 
     * @param id 体能科目项目主键
     * @return 结果
     */
    @Override
    public int deleteFirefighterSubjectById(Long id)
    {
        return firefighterSubjectMapper.deleteFirefighterSubjectById(id);
    }

    @Override
    public FirefighterSubject selectFirefighterInfoByIdAndName(Dcdate dcdate) {
        return firefighterSubjectMapper.selectFirefighterInfoByIdAndName(dcdate);
    }
}
